package com.portal.portal;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.portal.container.PortletContainerImpl;
import com.portal.util.constants.ServletAttributeKeys;

/**
 * handle portlet request
 */
public class PortalFilter implements Filter {

  private PortletContainerImpl container;
  private ServletContext servletContext;

  public void destroy() {
    container = null;
    servletContext = null;
  }

  public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException {
    // TODO Auto-generated method stub

  }

  public void init(FilterConfig filterConfig) throws ServletException {
    servletContext = filterConfig.getServletContext();
    container = (PortletContainerImpl) servletContext.getAttribute(ServletAttributeKeys.PORTLET_CONTAINER);
  }

}
